package mooc.adapter.self;

public class TeatAdapter {
	public static void main(String[] args)
	{
		Hotel hotel = new Hotel();
		DBSocketInterface dbSocket = new DBSocket();
		GBSocketInterface gbSocket = new GBSocket();
		SocketAdapter adapter = new SocketAdapter(gbSocket);
		
		// 不用适配器，只能用德国两孔圆头插座
//		hotel.setSocket(dbSocket);
//		hotel.charge();
		
		// 使用适配器转换后，用大陆插座
		hotel.setSocket(adapter);
		hotel.charge();
	}
}
